home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Can I assume the FIRST field of a STRUCT is at OFFSET 0?
- Date: Fri, 09 Feb 96 13:55:02 GMT
- Organization: none
- Distribution: world
- Message-ID: <823874102snz@genesis.demon.co.uk>
- References: <KIN.96Feb7142238@sampras.isi.com>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <KIN.96Feb7142238@sampras.isi.com> kin@isi.com "Kin Cho" writes:
-
- >I couldn't find reference to this in the K&C book.
- >Is this specified one way or the other in ANSI C?
- >Have you run into a platform where this assumption fails?
-
- The standard says:
-
- "There may therefore be unnamed padding within a structure object, but
- not at its beginning..."
-
- So the first structure member is required to be at offset 0.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-